import tensorflow as tf 
from tensorflow import keras
from tensorflow.keras import datasets, layers, optimizers, Sequential, callbacks
from matplotlib import pyplot as plt
from tensorflow.python.keras.layers.pooling import MaxPooling2D

def AConvNets():
    model = tf.keras.Sequential([
        layers.Input(shape=(88, 88, 1)),
        layers.Conv2D(16, kernel_size=[5, 5], padding='valid', activation='relu'),
        layers.MaxPool2D(pool_size=[2, 2], strides=2,padding='valid'),

        layers.Conv2D(32, kernel_size=[5, 5], padding='valid', activation='relu'),
        layers.MaxPool2D(pool_size=[2, 2], strides=2,padding='valid'),

        layers.Conv2D(64, kernel_size=[6, 6], padding='valid', activation='relu'),
        layers.MaxPool2D(pool_size=[2, 2], strides=2,padding='valid'),

        layers.Conv2D(128, kernel_size=[5, 5], padding='valid', activation='relu'),

        layers.Conv2D(10, kernel_size=[3, 3], padding='valid', activation='softmax'),
        layers.Flatten()]
    )

    return model

def AConvNets_BN():
    model = tf.keras.Sequential([
        layers.Input(shape=(88, 88, 1)),

        layers.Conv2D(16, kernel_size=[5, 5], padding='valid'),
        layers.BatchNormalization(),
        layers.Activation('relu'),
        layers.MaxPool2D(pool_size=[2, 2], strides=2,padding='valid'),


        layers.Conv2D(32, kernel_size=[5, 5], padding='valid'),
        layers.BatchNormalization(),
        layers.Activation('relu'),
        layers.MaxPool2D(pool_size=[2, 2], strides=2,padding='valid'),

        layers.Conv2D(64, kernel_size=[6, 6], padding='valid'),
        layers.BatchNormalization(),
        layers.Activation('relu'),
        layers.MaxPool2D(pool_size=[2, 2], strides=2,padding='valid'),

        layers.Conv2D(128, kernel_size=[5, 5], padding='valid'),
        layers.BatchNormalization(),
        layers.Activation('relu'),

        layers.Conv2D(10, kernel_size=[3, 3], padding='valid'),
        layers.BatchNormalization(),
        layers.Activation('softmax'),

        layers.Flatten()]
    )

    return model

